package it.poste.il.compensatore.utilities;

import java.net.URL;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import sun.util.logging.resources.logging_zh_CN;

/**
 * Class that extends Logger.
 */
public class LoggerCompensatore
{

	
	// logger instance
	private Logger logger = null;

	/**
	 * Take the Logger.
	 * @param o The class in use.
	 * @return Logger The logger.
	 */
	public LoggerCompensatore(String str) {
		this.logger = Logger.getLogger("WebApplication");
//		URL log4Jresource = this.getClass( ).getResource("/META-INF/log4j.properties");
		PropertyConfigurator.configure("./log4j.properties");
	}


	/**
	 * Take the logger.
	 * @param o The class in use.
	 * @return LoggerCompensatore The logger to return.
	 */
	public LoggerCompensatore getLogger(Object o) {
		logger.getLogger(o.getClass());
		return this;
	}
	
	/**
	 * Create the message for alignment to log.
	 * @param msg The message to log.
	 * @return void
	 */
	public void insertAlignment (String msg) {
	    //info("ALIGNMENT - Message: " + msg);
	}

	/**
	 * Create the message for cancellation to log.
	 * @param msg The message to log.
	 * @return void
	 */
	public void insertCancellation (String msg) {
	    //info("CANCELLATION - Message: " + msg);
	}

	/**
	 * Create the message for normal to log.
	 * @param msg The message to log.
	 * @return void
	 */
	public void insertNormal (String msg) {
	    //info("NORMAL - Message: " + msg);
	}
	public void info(String msg) {
		// TODO Auto-generated method stub
		//logger.info(msg);
	}
	public void error(String msg) {
		// TODO Auto-generated method stub
		logger.error(msg);

	}
	public void debug(String msg) {
		// TODO Auto-generated method stub
		logger.debug(msg);

	}
}